<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Absolute 绝对定位</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      body {
        background-color: aqua;
      }
      .parent {
        /* display: none; */
        /* opacity: 0; */
        width: 550px;
        height: 500px;
        background-color: pink;
        position: relative;
      }
      .child {
        width: 300px;
        height: 200px;
        background-color: rgb(163, 23, 149);
        position: absolute;
        right: 200px;
      }
      .box {
        width: 100px;
        height: 100px;
        background-color: green;
        position: absolute;
        left: 50%;
        right: 50%;
        transform: translate(-50%, -50%);
      }
    </style>
  </head>
  <body>
    <div class="parent">
      <div class="child"></div>
    </div>
    <div class="box">hello world</div>
  </body>
</html>
